<%-- 
    Document   : displayQuestion
    Created on : Oct 14, 2009, 11:14:42 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.sql.*" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <jsp:include page="time.jsp" />
    </head>
    <body>
        
        <table width="670">
            <tr>
                <td>

                    <form action="Result.jsp" name="myForm" method="post">
                        <span id="mincountdown"></span> phút
		(<span id="seccountdown"></span> giây)
                        <jsp:useBean id="Obj" class="DAO.DAOQuery" scope="request" />
                        
                        <%
                        
            String[] charater = {"A", "B", "C", "D", "E", "F", "G", "H"};
            int ida = Integer.parseInt(request.getParameter("id"));
            int j = 0;
            int i=1;
            ResultSet rs = null;
            ResultSet rss = null;
            rs = Obj.selectQuestion(ida);
            while (rs.next()) {
                        %>
                        <P style="font-size:18px"><%=i%> . <%=rs.getString("ContentQuestion")%></P>
                        <%
                int id = Integer.parseInt(rs.getString("QuestionID"));
                rss = Obj.selectAnswer(id);
                        %>
                        <input type="hidden" name="QuestionID" value="<%=id%>" />
                        <%
                while (rss.next()) {
                        %>
                        <input type="checkbox" name="Choice" value="<%=rss.getString("AnswerID")%>"/><%=charater[j]%> . <%=rss.getString("AnswerContent")%> <br>
                        <%
                    j++;
                }
                        %>
                        <%
                i++;
                j = 0;
            }
                        %>
                        <br>
                        <input type="button" value="Submit" onclick="doSubmit();"  />
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>
